﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GSync;
using NUnit.Mocks;

namespace UnitTesting
{
    public class GSyncFactoryTestingVersion: GSyncFactory
    {
        public static void OverrideInstanceType()
        {
            _Instance = new GSyncFactoryTestingVersion();
        }
       
        public DynamicMock localStorageMock;
        
        public override IDataProvider GetLocalContactStorage()
        {
            return localStorageMock.MockInstance as IDataProvider;
        }

        public DynamicMock remoteStorageMock;
        public override IDataProvider GetRemoteContactStorage()
        {
            return remoteStorageMock.MockInstance  as IDataProvider;
        }

  
        public override IHashCodesCacheManager GetHashCodesCache()
        {
            if (_HashCodesCacheInstance == null)
            {
                _HashCodesCacheInstance = new HashStorageStub();
            }
            return _HashCodesCacheInstance;
        }

        public DynamicMock conflictResolverMock;
        public override IConflictResolver GetConflictResolver()
        {
            return conflictResolverMock.MockInstance as IConflictResolver;
        }
    }
}
